home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global gSISystem, gSIVideo, gSIVideoPath, gSICDPath, gSIBackground, gSIHWnd
- identifySystem()
- if gSISystem = "UNKNOWN" then
- errorExit("Cannot establish system type")
- return
- end if
- initGlobals()
- initXObjects()
- if not (the result) then
- errorExit("Internal Error")
- return
- end if
- if objectp(gSIBackground) then
- gSIBackground(mHideInBack, 0)
- gSIBackground(mSetColor, 255)
- gSIBackground(mShow)
- end if
- HSInit()
- GSInit()
- GSLoad("awesome")
- readGlobalPrefs()
- if not (the result) then
- errorExit("Error Reading Global Prefs. Awsome.ini may not exist")
- return
- end if
- if not fileExists(gSICDPath & "intro.dir") then
- errorExit("Cannot find Awesome Athletes CD-ROM")
- return
- end if
- identifyVideo()
- if gSIVideo = "UNKNOWN" then
- errorExit("Cannot establish video type")
- return
- end if
- DVInit(gSISystem, gSIVideo)
- if not (the result) then
- errorExit("Error setting up digital video")
- return
- end if
- IAInit()
- GetWindowHandles()
- SetCursor(#wait)
- go(1, "intro")
- end
-
- on initGlobals
- global gSIPrefPath, gSIHDPath, gSICDPath, gSIXSuffix, gSIFileType, gSISystem, gSIUser, gSIUserFName, gSIPathSep, gSIlinkinfo
- set gSIHDPath to the moviePath
- set gSIPrefPath to gSIHDPath
- set gSIUser to EMPTY
- set gSIUserFName to EMPTY
- if gSISystem = "MAC" then
- set gSIXSuffix to EMPTY
- set gSIFileType to "TEXT"
- set gSIPathSep to ":"
- else
- set gSIXSuffix to ".DLL"
- set gSIFileType to "PRF"
- set gSIPathSep to "\"
- end if
- set gSIlinkinfo to EMPTY
- end
-
- on initXObjects
- global gSIXSuffix, gSIUtils, gSIEventQ, gSISystem, gSIFlush, gSIBackground, gSIPPReadInt, gSIPPWrite, gSIMiscX, gSIWinHelp, gSIActiveWindow, gSIShowWindow, gSIGotoURL
- if gSISystem = "MAC" then
- openXLib("MOVUTILS" & gSIXSuffix)
- openXLib("FlushXObj" & gSIXSuffix)
- openXLib("backdrop xobj" & gSIXSuffix)
- openXLib("Misc_X" & gSIXSuffix)
- set gSIUtils to MovieUtilities(mnew)
- if not objectp(gSIUtils) then
- return 0
- end if
- set gSIFlush to FlushXObj(mnew)
- if not objectp(gSIFlush) then
- return 0
- end if
- set gSIBackground to backdrop(mnew)
- if not objectp(gSIFlush) then
- return 0
- end if
- else
- if gSISystem = "WIN" then
- openXLib("FILEIO" & gSIXSuffix)
- openXLib("MOVUTILS" & gSIXSuffix)
- openXLib("EventQ" & gSIXSuffix)
- openXLib("DLLGLUE" & gSIXSuffix)
- openXLib("Misc_X" & gSIXSuffix)
- set gSIUtils to MovUtils(mnew)
- if not objectp(gSIUtils) then
- return 0
- end if
- set gSIEventQ to EventQ(mnew)
- if not objectp(gSIEventQ) then
- return 0
- end if
- set gSIPPReadInt to DLLGLUE(mnew, "KRNL386.EXE", "GetPrivateProfileInt", "W", "SSWS")
- if not objectp(gSIPPReadInt) then
- put "Duck1"
- return 0
- end if
- set gSIPPWrite to DLLGLUE(mnew, "KRNL386.EXE", "WritePrivateProfileString", "W", "SSSS")
- if not objectp(gSIPPWrite) then
- return 0
- end if
- set gSIWinHelp to DLLGLUE(mnew, "USER.EXE", "WinHelp", "W", "WSWU")
- if not objectp(gSIWinHelp) then
- return 0
- end if
- set gSIActiveWindow to DLLGLUE(mnew, "USER.EXE", "GetActiveWindow", "W", "V")
- if not objectp(gSIActiveWindow) then
- return 0
- end if
- set gSIShowWindow to DLLGLUE(mnew, "USER.EXE", "ShowWindow", "W", "WW")
- if not objectp(gSIShowWindow) then
- return 0
- end if
- openXLib("SIUTILS.DLL")
- set gSIGotoURL to DLLGLUE(mnew, "SIUTILS.DLL", "GotoURL", "V", "WS")
- if not objectp(gSIGotoURL) then
- return 0
- end if
- end if
- end if
- set gSIMiscX to Misc_X(mnew)
- if not objectp(gSIMiscX) then
- return 0
- end if
- return 1
- end
-
- on errorExit aText
- set the text of cast "Error Text" to aText
- go("Error")
- end
-
- on readGlobalPrefs
- global gSIPrefPath, gSICDPath, gSIPathSep, gSIVideoPath, gSIAudioPath, gSIImagePath, gSIBioPath
- set vFile to FileIO(mnew, "read", the moviePath & "awesome.ini")
- if not objectp(vFile) then
- return 0
- end if
- set vFound to 0
- repeat while objectp(vFile) and not vFound
- set vLine to vFile(mReadLine)
- if vLine contains "CDROMPATH=" then
- set vFound to 1
- end if
- end repeat
- if objectp(vFile) then
- vFile(mdispose)
- end if
- delete char 1 to 11 of vLine
- set gSICDPath to stripCRLF(vLine)
- set gSICDPath to gSICDPath & gSIPathSep
- set gSIVideoPath to gSICDPath & "video" & gSIPathSep
- add(the searchPath, gSICDPath)
- return 1
- end
-
- on GetWindowHandles
- global gSISystem, gSIHWnd, gSIHParentWnd, gSIUtils
- if gSISystem = "WIN" then
- set gSIHWnd to gSIUtils(mGetNamedWindowHdl, "Stage")
- set vGetParent to DLLGLUE(mnew, "USER.EXE", "GetParent", "W", "W")
- if not objectp(gSIWinHelp) then
- return
- end if
- set gSIHParentWnd to vGetParent(mCall, gSIHWnd)
- set gSIHParentWnd to vGetParent(mCall, gSIHParentWnd)
- vGetParent(mdispose)
- else
- set gSIHWnd to 0
- end if
- end
-